package com.zy.imagineCommunity.dao;

import com.zy.imagineCommunity.entity.FriendsText;
import com.zy.imagineCommunity.entity.PostText;
import com.zy.imagineCommunity.entity.Friends;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper //mybatis标记注解bean
public interface FriendsMapper {

    //增加好友
    public int addFriends(Friends friends);

    //痛过id查找好友
    public Friends queryFriendsById(int id);

    //痛过id修改好友状态
    public int updateFriendsById(Friends friends);

    //根据parentId和状态查询总记录数
    public int queryFriendsCountTotalByParentIdAndStatus(int parentId, int status);

    //根据parentId、状态、起始条数、每页个数查询好友
    public List<FriendsText> queryFriendsByParentIdAndStatusAndBeginAndPageSize(int parentId, int status, int begin, int pageSize);

    //根据userId和状态查询总记录数
    public int queryApplyCountTotalByUserIdAndStatus(int userId, int status);

    //根据userId、状态、起始条数、每页个数查询申请
    public List<FriendsText> queryApplyByUserIdAndStatusAndBeginAndPageSize(int userId, int status, int begin, int pageSize);

    //根据id删除申请或者好友
    public int deleteFriendsOrApplyById(int id);

    Friends queryFriendsByUserIdAndParentId(int userId, int parentId);

    //通过用户id和父id删除好友
    void deleteFriend(int userId, int parentId);

    //查询好友时多少数
    int queryFriendsCountTotalByParentIdAndStatusAndSearchValue(int parentId, int status, String searchValue);

    //查询好友
    List<FriendsText> queryFriendsByParentIdAndStatusAndBeginAndPageSizeAndSearchValue(int parentId, int status, int begin, int pageSize, String searchValue);

}
